package com.sokal.easycare.enums;

/**
 * 订单相关枚举类
 * 
 * @author sheep
 *
 */
public class OrderEnums {

	/**
	 * 工单类型
	 * 
	 * @author sheep
	 */
	public static enum WorkOrderTypeEnum {

		sale("0", "销售工单"), install("1", "安装工单"), design("2", "设计工单"), purchase("3", "采购工单"),service("4", "售后工单"),;

		private String value = null;
		private String desc = null;

		private WorkOrderTypeEnum(String v, String desc) {
			this.value = v;
			this.desc = desc;
		}

		public String value() {
			return this.value;
		}

		public String desc() {
			return this.desc;
		}

		public static String getDesc(String value) {
			if (value == null)
				return null;
			for (WorkOrderTypeEnum se : WorkOrderTypeEnum.values()) {
				if (se.value.equals(value)) {
					return se.desc();
				}
			}
			return null;
		}
	}

	/**
	 * 销售工单状态
	 * 
	 * @author sheep
	 */
	public static enum SaleWorkOrderStatusEnum {
		wait_offer("1", "待报价"), wait_Design("2", "待设计"), wait_install("3", "待安装 "), alreadyCompleted("4",
				"已完成"), refuse("5", "拒绝");
		private String value = null;
		private String desc = null;

		private SaleWorkOrderStatusEnum(String v, String desc) {
			this.value = v;
			this.desc = desc;
		}

		public String value() {
			return this.value;
		}

		public String desc() {
			return this.desc;
		}

		public static String getDesc(String value) {
			if (value == null)
				return null;
			for (SaleWorkOrderStatusEnum se : SaleWorkOrderStatusEnum.values()) {
				if (se.value.equals(value)) {
					return se.desc();
				}
			}
			return null;
		}
	}
	/**
	 * 采购工单状态
	 * 
	 * @author sheep
	 */
	public static enum PurchaseWorkOrderStatusEnum {
//		wait_Payment("1", "待支付"), 
		wait_delivery("1", "待发货"), wait_receipt("2", "待收货"), alreadyCompleted("4",
				"已完成"), refuse("5", "取消"),saleConfirm("6","销售已确认"),supervisorConfirm("7","监理已确认");
		private String value = null;
		private String desc = null;

		private PurchaseWorkOrderStatusEnum(String v, String desc) {
			this.value = v;
			this.desc = desc;
		}

		public String value() {
			return this.value;
		}

		public String desc() {
			return this.desc;
		}

		public static String getDesc(String value) {
			if (value == null)
				return null;
			for (PurchaseWorkOrderStatusEnum se : PurchaseWorkOrderStatusEnum.values()) {
				if (se.value.equals(value)) {
					return se.desc();
				}
			}
			return null;
		}
	}

	/**
	 * 安装工单状态
	 * 
	 * @author sheep
	 */
	public static enum InstallWorkOrderStatusEnum {

		wait_accept("1", "待接受"), implementationing("2", "实施中"), alreadyCompleted("4", "已完成"), refuse("5", "拒绝");
		private String value = null;
		private String desc = null;

		private InstallWorkOrderStatusEnum(String v, String desc) {
			this.value = v;
			this.desc = desc;
		}

		public String value() {
			return this.value;
		}

		public String desc() {
			return this.desc;
		}

		public static String getDesc(String value) {
			if (value == null)
				return null;
			for (InstallWorkOrderStatusEnum se : InstallWorkOrderStatusEnum.values()) {
				if (se.value.equals(value)) {
					return se.desc();
				}
			}
			return null;
		}
	}

	/**
	 * 设计工单状态
	 * 
	 * @author sheep
	 */
	public static enum DesignWorkOrderStatusEnum {

		wait_offer("1", "待报价"), wait_payment("2", "设计中"), wait_confirm("3", "待确认"), alreadyCompleted("4",
				"已完成"), refuse("5", "拒绝");
		private String value = null;
		private String desc = null;

		private DesignWorkOrderStatusEnum(String v, String desc) {
			this.value = v;
			this.desc = desc;
		}

		public String value() {
			return this.value;
		}

		public String desc() {
			return this.desc;
		}

		public static String getDesc(String value) {
			if (value == null)
				return null;
			for (DesignWorkOrderStatusEnum se : DesignWorkOrderStatusEnum.values()) {
				if (se.value.equals(value)) {
					return se.desc();
				}
			}
			return null;
		}
	}

	/**
	 * 售后工单状态
	 * 
	 * @author sheep
	 */
	public static enum serviceWorkOrderStatusEnum {
		wait_offer("1", "待报价"), wait_payment("2", "待付款"), In_treatment("3", "处理中"), alreadyCompleted("4",
				"已完成"), refuse("5", "拒绝");
		private String value = null;
		private String desc = null;

		private serviceWorkOrderStatusEnum(String v, String desc) {
			this.value = v;
			this.desc = desc;
		}

		public String value() {
			return this.value;
		}

		public String desc() {
			return this.desc;
		}

		public static String getDesc(String value) {
			if (value == null)
				return null;
			for (serviceWorkOrderStatusEnum se : serviceWorkOrderStatusEnum.values()) {
				if (se.value.equals(value)) {
					return se.desc();
				}
			}
			return null;
		}
	}

	/**
	 * 订单类型
	 * 
	 * @author sheep
	 */
	public static enum OrderTypeEnum {
		installOrder("1", "安装订单"), designOrder("2", "设计订单"), serviceOnOrder("3", "无订单的售后订单"), serviceOrder("4",
				"有订单的售后订单");

		private String value = null;
		private String desc = null;

		private OrderTypeEnum(String v, String desc) {
			this.value = v;
			this.desc = desc;
		}

		public String value() {
			return this.value;
		}

		public String desc() {
			return this.desc;
		}

		public static String getDesc(String value) {
			if (value == null)
				return null;
			for (OrderTypeEnum se : OrderTypeEnum.values()) {
				if (se.value.equals(value)) {
					return se.desc();
				}
			}
			return null;
		}
	}

	/**
	 * 订单状态  
	 * 
	 * @author sheep
	 */
	public static enum OrderStatusEnum  {
		waitingList("1", "待处理"), waitingSign("2","待签字"),In_treatment("3", "施工中"),  completed("4",
				"已完成"), canceled("5", "已取消");
		
		private String value = null;
		private String desc = null;
		
		private OrderStatusEnum (String v, String desc) {
			this.value = v;
			this.desc = desc;
		}
		
		public String value() {
			return this.value;
		}
		
		public String desc() {
			return this.desc;
		}
		
		public static String getDesc(String value) {
			if (value == null)
				return null;
			for (OrderStatusEnum se : OrderStatusEnum.values()) {
				if (se.value.equals(value)) {
					return se.desc();
				}
			}
			return null;
		}
	}

}
